{% extends 'cms/cms_base.html' %}
{% from 'common/_macro.html' import static %}

{% block title %}版块管理{% endblock %}

{% block head %}
    <script src="{{ static('cms/js/boards.js') }}"></script>
    <style>
        .top-box button{
            float:right;
        }
    </style>
{% endblock %}

{% block page_mail %}
    <h1>版块管理页面</h1>
    <div class="top-box">
        <button class="btn btn-warning" data-toggle="modal" data-target="#banner-dialog" id="add-board-btn">
            添加版块</button>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>版块名称</th>
                <th>贴子数量</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        {% for board in boards %}
            <tr data-id="{{ board.id }}" data-name="{{ board.name }}">
                <td>{{ board.name }}</td>
                <td>0</td>
                <td>{{ board.create_time }}</td>
                <td>
                     <button class="btn btn-default btn-xs edit-banner-btn">编辑</button>
                     <button class="btn btn-danger btn-xs delete-banner-btn">删除</button>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}